<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>array</title>
		<script>
			var a=new Array(10);
			a[0]="老吴";
			a[1]="老liu";
			a[2]="老张";
			a[100]="老汪";
			console.log(a.length);
			var b=["a","b","c","dog"];
			b.push("海豹","鲨鱼","鳐鱼","海狮","美人鱼");
			console.log(a.join("#"));
			console.log(b.join("-"));
			var c=b.concat(a);
			console.log(c.length);
			console.log(c.join(","));
			c.length=20;
			console.log(c.join(","));
			c["clsName"]="java78";
			c["dirTeacher"]="老刘和老李";
			console.log(c.length);//20+2
			console.log(c["dirTeacher"]);
			for(x in c){
				console.log(x+":"+c[x]);
			}
			//console.log(c.keys());
			//var ir=c.keys();
			//for(x of ir)
			//	console.log(x);
		</script>
	</head>
	<body>
	</body>
</html>